#ifndef _JANNA_PUBSUB_H_
#define _JANNA_PUBSUB_H_

#include <log_util.h>

#include <QMap>
#include <QObject>
#include <QString>
#include <QVariant>

#include "janna/janna_type.h"

class Pubsub : public QObject {
    Q_OBJECT

public:
    static Pubsub* getInstance();

private:
    Pubsub();
    static Pubsub* pubusb_self;

private:
    std::shared_ptr<spdlog::logger> log;

public:
    void publish(const JannaTopic& topic, const QMap<QString, QVariant>& param);

signals:
    void signalPublish(const JannaTopic& topic, const QMap<QString, QVariant>& param);
};

#endif
